feat(cos): heal zombie issues — partial-ship hybrid + issue-reconcile task#2242
Merged
Conversation
… task Partially-completed issues were left OPEN + `in-progress` after their PR merged, so the claim queue (which skips `in-progress`) never re-picked the remaining scope (e.g. #2220, #2179, #2175). The completion flow was binary (fully-done → close + unlabel) and the branch reconciler is branch-centric, so it never touched the linked issue. Two fixes: - claim-issue / -gitlab / -jira prompts now choose the PR trailer deliberately (Closes for a full ship, Refs + a `## Remaining` section for a partial one) and Phase 7 reconciles the issue with an agent-judged hybrid: close + file a scoped follow-up when the remainder is a separable chunk, else post a done/remaining comment + release the `in-progress` claim so the queue re-picks it (JIRA records remaining scope + files a follow-up ticket). - new opt-in per-app `issue-reconcile` CoS task (sibling to branch-reconcile, disabled by default): a deterministic gh/git scan finds zombie issues (open + in-progress yet with their PR merged and no live claim anywhere) and dispatches a coordinator agent that applies the same hybrid, with an `autoClose` toggle (OFF ⇒ comment + release only) and follow-up dedup so federated peers can't file duplicates. Perpetual drain with a convergence signature. Prompt-version discipline: claim-issue 3→4, -gitlab 2→3, -jira 1→2, outgoing bodies preserved verbatim in PREVIOUS_DEFAULT_PROMPTS, integrity snapshot regenerated. New module server/services/issueReconcile.js + 30 unit tests. Claude-Session: https://claude.ai/code/session_013EZAPV4vq8A1ea6TB45kXq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A partially-completed issue became an un-claimable zombie: OPEN +
in-progress+ assigned, with its PR already merged. The claim queue treatsin-progressas "claimed and being worked" and skips it, so the remaining scope is never re-picked and never finished. Live examples caught in the wild: #2220, #2179, #2175 (all healed by hand as part of this work — #2220 closed with follow-up #2241 filed; #2179/#2175 released for re-claim).Root cause: the completion flow had no partial completion state.
/do:nextPhase 7 was binary (fully-done → close + unlabel), and the branch reconciler is branch-centric so it never touched the linked issue.Fix (agent-judged hybrid, applied in two places)
Part A — teach the claim flow to partial-ship (
claim-issue/-gitlab/-jira):Closes #Nfor a full ship,Refs #N+ a## Remainingsection for a partial one.planfollow-up (Refs #orig); continuation → keep open, postDone ✓ / Remaining ▢, removein-progress+ assignee so the queue re-picks it. JIRA records remaining scope + files a follow-up ticket.claim-issue3→4,-gitlab2→3,-jira1→2; outgoing bodies preserved verbatim inPREVIOUS_DEFAULT_PROMPTS; integrity snapshot regenerated.Part B — new
issue-reconcileper-app CoS task (sibling tobranch-reconcile, disabled by default):server/services/issueReconcile.js— pure classifier +gh/gitgatherers. A ZOMBIE is open +in-progresswith a linked merged PR and no live claim anywhere (no open PR, no local/remote/CoS claim branch, no active agent). Boundary-safe ref/#nummatching (issue-222never matches insideissue-2220).cosTaskGenerator.js, parallel to branch-reconcile — perpetual drain with azombieSignatureconvergence guard; parks when clean.autoClosetoggle (ON default; OFF ⇒ comment + release only). Coordinator dedupes follow-ups via aRefs #origsearch so federated peers can't file duplicates.taskSchedule(interval +MANAGED_AGENT_OPTIONS+ description),versions.js,cosValidationallowlist, and the coordinator prompt.v1 zombie scan is GitHub-only (parks on non-GitHub apps); GitLab/JIRA siblings deferred.
Tests
server/services/issueReconcile.test.js— 30 new unit tests (ref/reference matchers, ZOMBIE/LIVE/STALLED classifier, end-to-end reconcile over mocked gh+git, signature, prompt formatting).Design record:
docs/plans/2026-07-06-issue-reconcile.md.https://claude.ai/code/session_013EZAPV4vq8A1ea6TB45kXq